<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%--<%@taglib prefix="s" uri="/struts-tags"%>--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>基础数据列表</title>
    <jsp:include page="../../../head.jsp"/>
</head>
<script type="text/javascript">
    var setting = {
        async: {
            enable: true,
            url: "sysval-treeData",
            autoParam: ["id", "name=n", "level=lv"],
            dataFilter: filter
        },
        data: {
            keep: {
                parent: true
            },
            key: {
                name: "chn"
            },
            simpleData: {
                pIdKey: "parenetId"
            }
        },
        callback: {
            onClick: function (event, treeId, treeNode, clickFlag) {
                $('#center', window.parent.document).attr("src",
                                                          "sysval-manage?parentId=" + treeNode.id);
            }
        }
    };
    function filter(treeId, parentNode, childNodes) {
        if (!childNodes)
            return null;
        return childNodes;
    }
    function refresh() {
        $.fn.zTree.getZTreeObj("sysVallist").reAsyncChildNodes(null, "refresh");
    }
    var add = function () {
        $('#center', window.parent.document).attr("src", "sysval-add");
    };
    $(document).ready(
            function () {
                $.fn.zTree.init($("#sysVallist"), setting);
                $("#treeButton input:button").button().css("font-size", "60%")
                        .click(add);
            }
    );
</script>
<body class="ui-widget-content remove_border" style="height: 100%">
<div style="width: 15%; float: left;">
    <div id="treeButton">
        <input type="button" value="新增类型"/>
    </div>
    <ul id="sysVallist" class="ztree"></ul>
</div>
</body>
</html>
